//转移表-加，减，乘
#include<stdio.h>
//加
int Add(int x, int y) {
	return x + y;
}
//减
int Sub(int x, int y) {
	return x - y;
}
//乘
int Mul(int x, int y) {
	return x * y;
}

void Menu(){
	printf("***********************\n");
	printf("***  1.Add   2.Sub  ***\n");
	printf("****     3.Mul     ****\n");
	return;
}
int main(){
	 Menu();
	int (*p[4])(int x, int y) = { 0,Add,Sub,Mul };
	int select, x, y;
	while (1) {
		printf("请选择>>");
		scanf("%d", &select);
		if (select >= 1 && select <= 3) {
			printf("请输入两个数!>>");
			scanf("%d %d", &x, &y);
			printf("%d\n", p[select](x, y));
			break;
		}
		else
			printf("选择错误!\n");
	}
	return 0;
}